﻿using System;
using System.Data;
using System.Data.SqlClient;
using PPIProxy.PPIWebservice;

namespace PPIProxy
{
    public class WVendor_Visit_XMissionStructures_Pole
    {
        #region Query

        public static DataSet GetServerPoles(string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Vendor_Visit_XMissionStructures_Pole_GetServerPoles(connectionKey);
        }

        public static DataSet GetByStructureID(int structureID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Vendor_Visit_XMissionStructures_Pole_GetByStructureID(structureID, connectionKey);
        }

        public static int GetTotal(string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Vendor_Visit_XMissionStructures_Pole_GetTotal(connectionKey);
        }

        #endregion Query

        #region Crud

        public static Int32 Insert(Int32 Vendor_Visit_XMissionStructureID, Int32 XMissionStructures_PoleTopTypeID, Int32 XMissionStructures_PoleSpeciesID, Int32 XMissionStructures_PoleTreatmentID, Int32 Year, Int32 XMissionStructures_PoleClassID, double Latitude, double Longitude, double Altitude, Int32 SatelliteCount, DateTime SatelliteTime, string AID, Int32 LVisit, string Number, double Length, string LVisitor, bool SolutionAvaible, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return
                serv.Vendor_Visit_XMissionStructures_Pole_Insert(Vendor_Visit_XMissionStructureID,
                                                                 XMissionStructures_PoleTopTypeID,
                                                                 XMissionStructures_PoleSpeciesID,
                                                                 XMissionStructures_PoleTreatmentID, Year,
                                                                 XMissionStructures_PoleClassID, Latitude, Longitude,
                                                                 Altitude, SatelliteCount, SatelliteTime, AID, LVisit,
                                                                 Number, Length, LVisitor, SolutionAvaible,
                                                                 connectionKey);
        
        }

        public static void Update(Int32 poleID, Int32 Vendor_Visit_XMissionStructureID, Int32 XMissionStructures_PoleTopTypeID, Int32 XMissionStructures_PoleSpeciesID, Int32 XMissionStructures_PoleTreatmentID, Int32 Year, Int32 XMissionStructures_PoleClassID, double Latitude, double Longitude, double Altitude, Int32 SatelliteCount, DateTime SatelliteTime, string AID, Int32 LVisit, string Number, double Length, string LVisitor, bool SolutionAvaible, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Vendor_Visit_XMissionStructures_Pole_Update(poleID, Vendor_Visit_XMissionStructureID,
                                                             XMissionStructures_PoleTopTypeID,
                                                             XMissionStructures_PoleSpeciesID,
                                                             XMissionStructures_PoleTreatmentID, Year,
                                                             XMissionStructures_PoleClassID, Latitude, Longitude,
                                                             Altitude, SatelliteCount, SatelliteTime, AID, LVisit,
                                                             Number, Length, LVisitor, SolutionAvaible,
                                                             connectionKey);
            
        }

        public static void Delete(Int32 poleID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Vendor_Visit_XMissionStructures_Pole_Delete(poleID, connectionKey);
        }

        public static void DesasocciateImages(Int32 poleID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Vendor_Visit_XMissionStructures_Pole_DesasocciateImages(poleID, connectionKey);
        }
        #endregion
    }
}
